home *** CD-ROM | disk | FTP | other *** search
/ Click Press Kit / Click Press Kit.iso / pc / main.dxr / Internal_52_GalleryFrameCode.ls < prev    next >
Encoding:
Text File  |  2006-05-31  |  4.7 KB  |  116 lines

  1. property pLeftArrowSprite, pPageSprite, pRightArrowSprite, pLogoSprite
  2. global gMaster, gSound, gTracker
  3.  
  4. on enterFrame me
  5.   sendAllSprites(#mSetUpGraphics)
  6. end
  7.  
  8. on exitFrame me
  9.   gMaster.pmarker = the frameLabel
  10.   gTracker.mAddSection(gMaster.pmarker)
  11.   cursor(-1)
  12.   gSound.mResumeSound()
  13.   pLogoSprite = 3
  14.   pLeftArrowSprite = 22
  15.   pPageSprite = 23
  16.   pRightArrowSprite = 24
  17.   if gMaster.pPhotoList[gMaster.pPhotoList.count].pGalleryNumber > 1 then
  18.     sprite(pLeftArrowSprite).visible = 1
  19.     sprite(pPageSprite).visible = 1
  20.     sprite(pRightArrowSprite).visible = 1
  21.   else
  22.     sprite(pLeftArrowSprite).visible = 0
  23.     sprite(pPageSprite).visible = 0
  24.     sprite(pRightArrowSprite).visible = 0
  25.   end if
  26.   vPosition = offset("g", gMaster.pmarker)
  27.   gMaster.pGalleryCount = value(gMaster.pmarker.char[1..vPosition - 1])
  28.   gMaster.pGalleryPhotosList = []
  29.   repeat with x = 1 to gMaster.pPhotoList.count
  30.     if gMaster.pPhotoList[x].pGalleryNumber = gMaster.pGalleryCount then
  31.       add(gMaster.pGalleryPhotosList, gMaster.pPhotoList[x])
  32.     end if
  33.   end repeat
  34.   vGalleryCount = gMaster.pPhotoList[gMaster.pPhotoList.count].pGalleryNumber
  35.   vText = "Page " & gMaster.pGalleryCount & " of " & vGalleryCount
  36.   member("Page", "assets").text = vText
  37.   if gMaster.pGalleryPhotosList.count = 0 then
  38.     alert("the gMaster.pGalleryPhotosList list is empty")
  39.     exit
  40.   else
  41.     if gMaster.pGallerySettings.xyeffect = "TRUE" then
  42.       vSpriteCount = gMaster.pPhotoSpriteStartNum
  43.       repeat with x = 1 to gMaster.pGalleryPhotosList.count
  44.         sprite(vSpriteCount).member = member(gMaster.pGalleryPhotosList[x].pSmallName, gMaster.pSmallCastLib)
  45.         sprite(vSpriteCount).loc = gMaster.pGalleryPhotosList[x].pXYGallery
  46.         vMemberWidth = member(gMaster.pGalleryPhotosList[x].pSmallName, gMaster.pSmallCastLib).width
  47.         vMemberHeight = member(gMaster.pGalleryPhotosList[x].pSmallName, gMaster.pSmallCastLib).height
  48.         vWidth = vMemberWidth * float("." & gMaster.pGallerySettings.percentage)
  49.         vHeight = vMemberHeight * float("." & gMaster.pGallerySettings.percentage)
  50.         if gMaster.pGallerySettings.percentage = 100 then
  51.           sprite(vSpriteCount).width = vMemberWidth
  52.           sprite(vSpriteCount).height = vMemberHeight
  53.         else
  54.           sprite(vSpriteCount).width = vWidth
  55.           sprite(vSpriteCount).height = vHeight
  56.         end if
  57.         vSpriteCount = vSpriteCount + 1
  58.       end repeat
  59.       updateStage()
  60.     end if
  61.     if gMaster.pGallerySettings.blendeffect = "TRUE" then
  62.       vSpriteCount = gMaster.pPhotoSpriteStartNum
  63.       repeat with x = 1 to gMaster.pGalleryPhotosList.count
  64.         if gMaster.pGalleryPhotosList[x].pSelected = "no" then
  65.           sprite(vSpriteCount).blend = 100
  66.         else
  67.           sprite(vSpriteCount).blend = gMaster.pGallerySettings.blendpercent
  68.         end if
  69.         vSpriteCount = vSpriteCount + 1
  70.       end repeat
  71.     end if
  72.     if gMaster.pGallerySettings.rectangles = "TRUE" then
  73.       vSpriteCount = gMaster.pPhotoSpriteStartNum
  74.       vSpriteCount2 = gMaster.pRectangleSpriteStartNum
  75.       repeat with x = 1 to gMaster.pGalleryPhotosList.count
  76.         if gMaster.pGalleryPhotosList[x].pSelected = "no" then
  77.           sprite(vSpriteCount2).rect = rect(-2000, -2000, -1999, 1999)
  78.         else
  79.           vLeft = sprite(vSpriteCount).left - 2
  80.           vTop = sprite(vSpriteCount).top - 2
  81.           vRight = sprite(vSpriteCount).right + 2
  82.           vBottom = sprite(vSpriteCount).bottom + 2
  83.           sprite(vSpriteCount2).rect = rect(vLeft, vTop, vRight, vBottom)
  84.         end if
  85.         vSpriteCount = vSpriteCount + 1
  86.         vSpriteCount2 = vSpriteCount2 + 1
  87.       end repeat
  88.     end if
  89.     if gMaster.pGallerySettings.pushpin = "TRUE" then
  90.       vSpriteCount = gMaster.pPhotoSpriteStartNum
  91.       vSpriteCount2 = gMaster.pPushPinSpriteStartNum
  92.       repeat with x = 1 to gMaster.pGalleryPhotosList.count
  93.         if gMaster.pGalleryPhotosList[x].pSelected = "no" then
  94.           sprite(vSpriteCount2).loc = point(-2000, -2000)
  95.         else
  96.           vLeft = sprite(vSpriteCount).left + gMaster.pGallerySettings.pinoffset[1]
  97.           vTop = sprite(vSpriteCount).top + gMaster.pGallerySettings.pinoffset[2]
  98.           sprite(vSpriteCount2).loc = point(vLeft, vTop)
  99.         end if
  100.         vSpriteCount = vSpriteCount + 1
  101.         vSpriteCount2 = vSpriteCount2 + 1
  102.       end repeat
  103.     end if
  104.   end if
  105.   if gMaster.pGallerySettings.titlelogoeffect = "TRUE" then
  106.     repeat with z = 1 to gMaster.pPhotoList.count
  107.       if gMaster.pGalleryCount = gMaster.pPhotoList[z].pGalleryNumber then
  108.         vLogoName = gMaster.pPhotoList[z].pTitleGallery
  109.         exit repeat
  110.       end if
  111.     end repeat
  112.     sprite(pLogoSprite).member = member(vLogoName)
  113.     sprite(pLogoSprite).loc = gMaster.pGallerySettings.xytitle
  114.   end if
  115. end
  116.